name: Build
on: [push, pull_request]
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  make-check:
    runs-on: ubuntu-latest
    container: fedora:latest
    permissions:
      contents: read
    env:
      CFLAGS: -Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-parameter -ggdb3
    steps:
    - uses: actions/checkout@v2
    - name: Install dependencies
      run: |
        scripts/auto install-build-deps
    - run: autoreconf -if && ./configure --enable-silent-rules
    - run: make
    - run: make check
    - run: make distcheck
    - name: Check translations
      run: |
        if [ -s "translations.log" ]; then
          cat translations.log
          exit 1
        else
          echo "All translations compiled successfully."
          exit 0
        fi
